package com.link2room.soundwave.entity;

import com.link2room.common.entity.BaseEntity;
import org.hibernate.annotations.DynamicInsert;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;

/**
 * @author sqj88
 * @date 2018/1/15 16:01
 */
@Entity
@Table(name = "l2r_yh_member_upgrade_detail")
@DynamicInsert
public class L2RYhMemberUpgradeDetail extends BaseEntity{
    private String groupCode;
    private String hotelCode;
    private String l2RMemberNo;
    private String serialNo;
    private String cardNo;
    private String customerId;
    private String cardType;
    private String cardLevel;
    private String toCardLevel;
    private BigDecimal useAmount;
    private BigDecimal usePoint;
    private BigDecimal ruleAmount;
    private BigDecimal rulePoint;
    private String relation;
    private String isSuccess;
    private String name;
    private String mobile;

    @Basic
    @Column(name = "group_code", nullable = false, length = 20)
    public String getGroupCode() {
        return groupCode;
    }

    public void setGroupCode(String groupCode) {
        this.groupCode = groupCode;
    }

    @Basic
    @Column(name = "hotel_code", nullable = true, length = 20)
    public String getHotelCode() {
        return hotelCode;
    }

    public void setHotelCode(String hotelCode) {
        this.hotelCode = hotelCode;
    }

    @Basic
    @Column(name = "l2r_member_no", nullable = false, length = 20)
    public String getL2RMemberNo() {
        return l2RMemberNo;
    }

    public void setL2RMemberNo(String l2RMemberNo) {
        this.l2RMemberNo = l2RMemberNo;
    }

    @Basic
    @Column(name = "serial_no", nullable = false, length = 32)
    public String getSerialNo() {
        return serialNo;
    }

    public void setSerialNo(String serialNo) {
        this.serialNo = serialNo;
    }

    @Basic
    @Column(name = "card_no", nullable = false, length = 20)
    public String getCardNo() {
        return cardNo;
    }

    public void setCardNo(String cardNo) {
        this.cardNo = cardNo;
    }

    @Basic
    @Column(name = "customer_id", nullable = false, length = 20)
    public String getCustomerId() {
        return customerId;
    }

    public void setCustomerId(String customerId) {
        this.customerId = customerId;
    }

    @Basic
    @Column(name = "card_type", nullable = true, length = 20)
    public String getCardType() {
        return cardType;
    }

    public void setCardType(String cardType) {
        this.cardType = cardType;
    }

    @Basic
    @Column(name = "card_level", nullable = true, length = 20)
    public String getCardLevel() {
        return cardLevel;
    }

    public void setCardLevel(String cardLevel) {
        this.cardLevel = cardLevel;
    }

    @Basic
    @Column(name = "to_card_level", nullable = true, length = 20)
    public String getToCardLevel() {
        return toCardLevel;
    }

    public void setToCardLevel(String toCardLevel) {
        this.toCardLevel = toCardLevel;
    }

    @Basic
    @Column(name = "use_amount", nullable = true, precision = 2)
    public BigDecimal getUseAmount() {
        return useAmount;
    }

    public void setUseAmount(BigDecimal useAmount) {
        this.useAmount = useAmount;
    }

    @Basic
    @Column(name = "use_point", nullable = true, precision = 2)
    public BigDecimal getUsePoint() {
        return usePoint;
    }

    public void setUsePoint(BigDecimal usePoint) {
        this.usePoint = usePoint;
    }

    @Basic
    @Column(name = "rule_amount", nullable = true, precision = 2)
    public BigDecimal getRuleAmount() {
        return ruleAmount;
    }

    public void setRuleAmount(BigDecimal ruleAmount) {
        this.ruleAmount = ruleAmount;
    }

    @Basic
    @Column(name = "rule_point", nullable = true, precision = 2)
    public BigDecimal getRulePoint() {
        return rulePoint;
    }

    public void setRulePoint(BigDecimal rulePoint) {
        this.rulePoint = rulePoint;
    }

    @Basic
    @Column(name = "relation", nullable = true, length = 16)
    public String getRelation() {
        return relation;
    }

    public void setRelation(String relation) {
        this.relation = relation;
    }

    @Basic
    @Column(name = "is_success", nullable = true, length = 2)
    public String getIsSuccess() {
        return isSuccess;
    }

    public void setIsSuccess(String isSuccess) {
        this.isSuccess = isSuccess;
    }

    @Basic
    @Column(name = "name", nullable = true, length = 20)
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Basic
    @Column(name = "mobile", nullable = true, length = 20)
    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        L2RYhMemberUpgradeDetail that = (L2RYhMemberUpgradeDetail) o;

        if (groupCode != null ? !groupCode.equals(that.groupCode) : that.groupCode != null) return false;
        if (hotelCode != null ? !hotelCode.equals(that.hotelCode) : that.hotelCode != null) return false;
        if (l2RMemberNo != null ? !l2RMemberNo.equals(that.l2RMemberNo) : that.l2RMemberNo != null) return false;
        if (serialNo != null ? !serialNo.equals(that.serialNo) : that.serialNo != null) return false;
        if (cardNo != null ? !cardNo.equals(that.cardNo) : that.cardNo != null) return false;
        if (customerId != null ? !customerId.equals(that.customerId) : that.customerId != null) return false;
        if (cardType != null ? !cardType.equals(that.cardType) : that.cardType != null) return false;
        if (cardLevel != null ? !cardLevel.equals(that.cardLevel) : that.cardLevel != null) return false;
        if (toCardLevel != null ? !toCardLevel.equals(that.toCardLevel) : that.toCardLevel != null) return false;
        if (useAmount != null ? !useAmount.equals(that.useAmount) : that.useAmount != null) return false;
        if (usePoint != null ? !usePoint.equals(that.usePoint) : that.usePoint != null) return false;
        if (relation != null ? !relation.equals(that.relation) : that.relation != null) return false;
        if (isSuccess != null ? !isSuccess.equals(that.isSuccess) : that.isSuccess != null) return false;
        if (name != null ? !name.equals(that.name) : that.name != null) return false;
        if (mobile != null ? !mobile.equals(that.mobile) : that.mobile != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = groupCode != null ? groupCode.hashCode() : 0;
        result = 31 * result + (hotelCode != null ? hotelCode.hashCode() : 0);
        result = 31 * result + (l2RMemberNo != null ? l2RMemberNo.hashCode() : 0);
        result = 31 * result + (serialNo != null ? serialNo.hashCode() : 0);
        result = 31 * result + (cardNo != null ? cardNo.hashCode() : 0);
        result = 31 * result + (customerId != null ? customerId.hashCode() : 0);
        result = 31 * result + (cardType != null ? cardType.hashCode() : 0);
        result = 31 * result + (cardLevel != null ? cardLevel.hashCode() : 0);
        result = 31 * result + (toCardLevel != null ? toCardLevel.hashCode() : 0);
        result = 31 * result + (useAmount != null ? useAmount.hashCode() : 0);
        result = 31 * result + (usePoint != null ? usePoint.hashCode() : 0);
        result = 31 * result + (relation != null ? relation.hashCode() : 0);
        result = 31 * result + (isSuccess != null ? isSuccess.hashCode() : 0);
        result = 31 * result + (name != null ? name.hashCode() : 0);
        result = 31 * result + (mobile != null ? mobile.hashCode() : 0);
        return result;
    }
}
